﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using ExpenseSystem.Common;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.CustomerModules
{
    public class CustomerHistoryBaseManager:CustomerHistoryManager
    {
        protected string tran = HttpContext.Current.Items[Definition.SESSION_TRAN_STR].ToString();

        protected UserProfile profile = Authority.Authority.GetUserProfile();
        public override bool Delete(CustomerHistoryModel CustomerHistory,  out string message)
        {

            CustomerHistoryFetcher fetcher = new CustomerHistoryFetcher();
            return updater.Remove(CustomerHistory, tran, fetcher, out message);
        }

        public override bool DeleteById(long[] CustomerHistory,  out string message)
        {

            CustomerHistoryFetcher fetcher = new CustomerHistoryFetcher();
            return updater.RemoveById(profile.SiteId, CustomerHistory, tran, fetcher, out message);
        }

        public override bool Save(CustomerHistoryModel CustomerHistory,  out string message, params IAddable<CustomerHistoryModel>[] addable)
        {

            CustomerHistoryFetcher fetcher = new CustomerHistoryFetcher();
            return updater.Save(CustomerHistory, tran, fetcher, out message);
        }
    }
}
